<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>数组</title>
	<script>
		
		num1 = "广州"
		num2 = "北京"
		num3 = "上海"

		addr = ["广州","北京","上海"];
		addr = ["广州","北京",[43,[435,3,3,3],45]];

		addr[100] = "东莞";

		console.log(addr);

		addr[1] = "珠海";

		console.log(addr);

		document.write(addr[2][2]);


		arr = [5,3,37,3,34,3];

		var num = 0;
		for(var i in  arr){
			num +=arr[i]
		}

		document.write(num);


		// 把数组 的和求出来


		console.log(arr);

		for (var i = 0; i <= addr.length-1 ; i++) {
			document.write(addr[i]+"<br>");
		}

		for(var i in addr){
			document.write(addr[i]+"<br>");
		}

		1 [23,23,23,234,32,67,3,3] 封装一个函数实现寻找最大值 

		2 [45,3,8,2]=>[90,6,8,2]
			封装一个函数实现把奇数变偶数

		3 [1,6,78,9,0] => [0,9,78,6,1]
			封装一个函数实现把数组反转

		4 [45,2,234,3,4,5]
		    封装一个函数实现把数组排序 

		// function get_max(arr) {
		// 	// body...
		// }


		// max = get_max([65,34,32,345,345]);




	</script>
</head>
<body>
	
</body>
</html>